home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / basic / qbbugs.zip / QUIRKS.TXT
Text File  |  1988-05-14  |  43KB  |  937 lines

  1. New items added 05/08/88 to 05/14/88:
  2.  
  3. Part 1 - READ (QB 4)
  4.      2 - Watching a non-existant variable (Sample program #13)
  5. -------------------------------------------------------------------------
  6.  
  7. This file contains information about bugs, quirks, and general points
  8. of interest to programmers working with compiled BASIC. It is divided
  9. into three parts:
  10.  
  11.   Part 1 - Description of bugs, quirks, etc.
  12.   Part 2 - General points of interest
  13.   Part 3 - Sample programs
  14.  
  15. If you want to find one of the above quickly, use your text editor to
  16. search for the text shown above. i.e., Search for "Part 1 -".
  17.  
  18. This file is maintained by Mark Novisoff of MicroHelp, Inc. Much of the
  19. information was contributed by members of MicroHelp's BASIC Users Group,
  20. users of the MSSYS forum on Compuserve and users of Mach 2, Stay-Res and
  21. The MicroHelp Toolbox.
  22.  
  23. If you have additional information that should be added, please send it
  24. to:
  25.      Mark Novisoff
  26.      MicroHelp, Inc.
  27.      2220 Carlyle Drive
  28.      Marietta GA 30062
  29.      Compuserve ID 73047,3706 in MSSYS (Microsoft Systems Forum)
  30.      
  31. If possible, please include a *small* sample program that will demonstrate
  32. the problem and cause it to happen whenever the program is run.     
  33.  
  34. Part 1 - Description of bugs, quirks, etc.
  35.  
  36. Note: * Next to a QB 4 entry indicates that the problem has been
  37.     fixed with the QB 4.00a that is included in BASCOM 6.
  38.  
  39. Command/Error  Compilers       Description
  40. -------------- --------------- --------------------------------------------
  41. $INCLUDE       QB 4            If you have a DEFINT statement in an include
  42.                                file and you wish to use it within subprograms/
  43.                    functions in a module, you must $INCLUDE it
  44.                    within each sub/function structure. If you
  45.                    simply include it in the mainline code, the
  46.                    DEFINT statement is not recognized. However,
  47.                    if you have a statement DEFINT in your mainline
  48.                    code (as opposed to $INCLUDE), it will work ok.
  49. BLOAD/BSAVE    QB 4            When using these commands in DOS 2.x, you may
  50.                                get an unexpected "too many files" error. This
  51.                    problem can be solved using an assembly 
  52.                    language routine to read/write the file.
  53.                    (Mach 2 users should use MhFile/MhRWSub).
  54. CALL (asm)     QB 4            Effective with QB 4, assembly
  55.                                language subroutines must preserve
  56.                                the SI and DI registers and make
  57.                                sure the direction flag is cleared
  58.                                before returning to BASIC.
  59.                    In addition, you must not have a label name
  60.                    after the END statement in your assembler code.
  61. CALL INIT      QB 2-3          Do not name a precompiled subprogram "INIT".
  62.                                If you do, the compiler will go into never-
  63.                    never land when your user library is loaded.
  64. CALL INTERRUPT QB 4*           There is a bug in the source code (INTRPT.ASM).
  65.                                If you have MASM 5.0, you can patch the source
  66.                    code and reassemble. On line 49, the code
  67.                    points to the DI register with "-1EH". This
  68.                    should be changed to "-0EH", followed by
  69.                    reassembly and library updates. If you don't
  70.                    have MASM 5.0, the solution is to use INT86OLD,
  71.                    or you can patch INTRPT.OBJ as follows (all
  72.                    numbers are hexadecimal):
  73.                    
  74.                    Address   Old Value  New Value
  75.                    -------   ---------  ----------
  76.                      20E        E2          F2
  77.                  253        E2          F2
  78.                  28D        0B          EB
  79. CALL vs GOSUB  All             If you have many calls to the same
  80.                                asm routine or subprogram, you'll
  81.                                use less memory if you set
  82.                                variables and GOSUB to a routine
  83.                                that performs the CALL instead of
  84.                                having the CALL "in line". CALL is
  85.                                much faster using variables than
  86.                                using "literals".
  87. CALLS          QB 4            If you are passing string arrays to an
  88.                                assembler subroutine, make sure that
  89.                    $Static is in effect (not $Dynamic). If
  90.                    you do not, the data are not pushed onto
  91.                    the stack correctly by BC. This affects
  92.                    the use of MhBasStringSort in Mach 2.
  93. CALLS          QB 4*           When CALLS (note the "S") is used and you
  94.                                compile with "/D" (debug), the segment of
  95.                    of a string element descriptor does not get
  96.                    passed on the stack. In other words, if you
  97.                    have an assembly language subroutine that
  98.                    uses CALLS, you should not compile with "/d".
  99. CHAIN          QB 4            Unreliable when using DOS 2.x.
  100. CIRCLE         QB 4            The start and end angles must be
  101.                                LESS than 2*pi. Previously they could
  102.                    be less than or equal to.
  103. CLEAR          QB 4            If you use SETMEM to free up memory for
  104.                                use by other routines or modules, the CLEAR
  105.                    statement does force the compiler to give
  106.                    up that memory. In other words, you must
  107.                    explicitly do a SETMEM(640*1024), or 
  108.                    other large number. (Also see RUN.)
  109. CLEAR,,Size    QB 3,4          If you receive an out of stack
  110.                                space message. The stack size is
  111.                                not reset between CHAIN'ing but if
  112.                                you CHAIN back to your original
  113.                                program, be sure to skip the CLEAR
  114.                                instruction.
  115. COMMON and     QB 2-4          All statements that use COMMON or variations
  116.   COMMON SHARED                thereon with CHAIN must use parameter lists
  117.                                that match exactly. Best done with $INCLUDE.
  118. COMMON with TYPE
  119.                QB 4            The TYPE statement must appear before
  120.                            the COMMON statement and must appear in
  121.                    all programs that use it. The COMMON
  122.                    statement must contain "AS". See sample
  123.                    program #1 at the end of this file.
  124. Compile to EXE QB 4            QB issues an unusual LINK command in the
  125.                                form of:
  126.                      LINK Prog+YourLib.Lib;
  127.                    This causes LINK to bring the entire
  128.                    library into your program! The solution is
  129.                    to exit QB, and run BC and LINK yourself.
  130. CONST          QB 4            Must be included in all program modules
  131.                                that use the constant. Place in the file
  132.                    at the top, rather than inside SUB's.
  133. CVL            QB 4*           This function is unreliable when a program
  134.                                has been compiled with BC. See sample
  135.                    program #8.
  136. DATA           QB 4            When a DATA statement is encountered inside
  137.                                a SUB...END SUB structure, QB moves it
  138.                    into the "mainline" portion of the code when
  139.                    you are in the environment. 
  140. DEFINT         QB 4            See $INCLUDE.
  141. DEF FN         All             Functions are local to the module
  142.                                in which the DEF FN appears. Use
  143.                                QB 4's FUNCTION..END FUNCTION for
  144.                                global functions.
  145. DEF SEG        QB 4*          See sample program #11.
  146. DIM            QB 3            See sample program #4. QB3 apparently has
  147.                                a limit of 123 dynamic arrays.
  148. DIM            QB 4            In order to take advantage of the /AH switch
  149.                                with TYPE..END TYPE records, the record
  150.                    length must be a power of 2 (4,8,16,32, etc.)
  151. DIM            QB 4            Static numeric arrays are stored on the
  152.                                "heap" when you are inside the QB 4
  153.                    environment. BC p